#include "widget.h"
#include "ui_widget.h"
#include "mythread.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    labelthread = new MyThread(this);
    labelthread->setUi(this->ui);
    connect(ui->pushButton_start, SIGNAL(clicked()), this, SLOT(startthread()));
    connect(ui->pushButton_stop, SIGNAL(clicked()), this, SLOT(stopthread()));
}

Widget::~Widget()
{
    delete ui;
}

void Widget::startthread()
{
    labelthread->start();
}

void Widget::stopthread()
{
    labelthread->terminate();
}

